<%@ include file="/Pages/Jsp/Common/header.jsp"%>
<div style="width:960px; margin-left:auto; margin-right:auto;">
<div class="">

<div id="NoticeField" class="span-10 last append-14">	
		<logic:present name="Success">
			<div class="notice">
				<b>${Success}</b>
			</div>
		</logic:present>
		<logic:present name="Failed">
			<div class="error">
				<b>${Failed}</b>
			</div>
		</logic:present>
</div>	
<script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/Pages/Js/userJS.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
		 
		var input1 = $("input[id='role1']:checked");
		var input2 = $("input[id='examinee']:checked");
		if(input2!=""){
			$.each(input1,function(i){
				input1[i].checked = false;}
				);
		}	
		if($(".requiredNotice").html()== ""){
	           $(".requiredNotice").hide(); 
	        }
	});    
</script>
      
      <form  name="frmCreate" action="<%=request.getContextPath()%>/user/modifyUser/modifyUser.do" method="post">
      	<div>
      	  <h3>Modify a User</h3>
      	  <hr/>
        </div>
        <div class="requiredNotice span-8 error " ></div>   
    	<hr class="space prepend"> 
         
        
          <p>
            <label class="span-4  align-left "><span class="errtxt"></span> Username:</label>
            <input readonly="readonly" name=username value="${info.userName}"></input>
         
          </p>
          <p>
            <label class="span-4 align-left "><span class="errtxt"></span> Password:</label>
            <input id="password" name="password"   class="span-4" type="password" >
          </p>
          <p>
            <label class="span-4 align-left "><span class="errtxt"></span> Confirm Password:</label>
            <input id="confirmpwd" name="confirmpwd"  class="span-4" type="password" >
         
            
            
          </p>  
          <p>
            <label class="span-4 align-left "><span class="errtxt">*</span> First Name:</label>
            <input id="firstname" name="firstname" onkeyup="checkInput(this)" value="${info.firstName}"  class="span-4" type="text">
            
          </p>
          <p>
            <label class="span-4 align-left "><span class="errtxt">*</span> Last Name:</label>
            <input id="lastname"  name="lastname" onkeyup="checkInput(this)" value="${info.lastName}"  class="span-4" type="text">
            
          </p>
          <p>
            <label class="span-4 align-left "><span class="errtxt">*</span> Email:</label>
            <input id="email"  name="email"   value="${info.email}"  class="span-4" type="text">
            
          </p>
           
           <logic:present name="yes11">
           <p>
				<label class="span-4 align-left ">
					<span class="errtxt">*</span> Category:
				</label>
				<input  id="category" name="category" value="trainee"  type="radio" onclick="roleChange(),bindRole()" <logic:present name="yes2">checked="checked"</logic:present> >Trainee
            <input  id="category" name="category" value="employee"  type="radio" onclick="roleChange()" <logic:present name="no2">checked="checked"</logic:present> >Employee
            
          </p>
          </logic:present>
          <logic:present name="no22">
           <p>
            <label class="span-4 align-left "><span class="errtxt">*</span> Category:</label>
            <input  id="category"  name="category" value="employee"  type="radio" onclick="roleChange()" <logic:present name="no2">checked="checked"</logic:present> >Employee
            
          </p>
          </logic:present>
           
           <logic:present name="yes11">
           <p id="employeeRoles" class="noDisplay">
            <label class="span-4 align-left "><span class="errtxt">*</span> Role:</label>
            
            <logic:iterate id="roleList" name="roleList" type="com.capgemini.fs.app.ekms.model.Role">
            <input id="role1" name="role"  value="<%=roleList.getName()%>" type="checkbox" <logic:present name="<%=roleList.getName()%>">checked="checked"</logic:present> ></input><%=roleList.getName()%>
            </logic:iterate>
            
          </p>
          <p id="traineeRole">
          	<label class="span-4 align-left "><span class="errtxt">*</span> Role:</label>
          	
          	<input type="checkbox" name="role" id="trainee" value="trainee" <logic:present name="trainee">checked="checked"</logic:present> />Visitor
            
          </p>
          </logic:present>
          
          <logic:present name="no22">
            <p>
            
            <label class="span-4 align-left "><span class="errtxt">*</span> Role:</label>
             
            <logic:iterate id="roleList" name="roleList" type="com.capgemini.fs.app.ekms.model.Role">
            <input id="role" name="role"  value="<%=roleList.getName()%>" type="checkbox" <logic:present name="<%=roleList.getName()%>">checked="checked"</logic:present> ></input><%=roleList.getName()%>
            </logic:iterate>
            
            </p>
          </logic:present> 
          <p>
          	     	
            <label class="span-4 align-left "><span class="errtxt"></span> Active:</label>
            <select id="Active" name="status"  class="span-4" name="selactive" >
              	<option value="0" id="isactive" <logic:present name="yes1">selected="selected"</logic:present>>Yes</option>
                <option value="1" id="noactive" <logic:present name="no1">selected="selected"</logic:present>>No</option>
            </select>
            
          </p>
          <div>
            <label class="span-4 align-left "> Group:</label>
            <div class="mutifields">
            <logic:iterate id="groupList" name="groupList" type="com.capgemini.fs.app.ekms.model.Group">
            <input id="ckbgroup" name="group" value="<%=groupList.getGroupName()%>" type="checkbox"<logic:present name="<%=groupList.getGroupName()%>">checked="checked"</logic:present>></input><%=groupList.getGroupName()%>
            </logic:iterate>
            </div>
          </div>
          <p>
            <label class="span-4 align-left "><span class="errtxt"></span> Phone No.:</label>
            <input id="phoneno" name="phoneno" value="${info.phoneNo}"  class="span-4" type="text">
            <SPAN class="errorText"><html:errors property="phoneno"/></SPAN>
          </p>
			 
          <hr class="space">
          <p>
          </p><div class=" align-left">
            <input value="Save" type="button"  onClick="emptyValidation()"></input> 
            <input value="Reset" type="reset" onClick="modifyReset()">
            <input value=" Back" type="button" onclick="history.back()">
          <hr class="space"/>
          </div> 
           
      </form>
      
    </div>
</div>